package com.naiterui.ehp.bs.patient.vo.requestparam;

import org.apache.commons.lang3.StringUtils;

import com.naiterui.ehp.bs.patient.utils.StringUtil;

/**
 * 患者基础信息参数
 *
 * @version 2015年6月24日 下午7:34:45 by Amber
 */
public class PatientBaseParam {
    private String name;
    private String photo;
    private Integer gender;
    private Integer age;
    private Integer cityId;
    private String phone;
    private String code;
    /**
     * 身份证号
     */
    private String idCard;
    /**
     * 出生日期
     */
    private String birthday;
    /**
     * 居住详细地址
     */
    private String address;
    /**
     * 紧急联系人姓名
     */
    private String contactName;
    /**
     * 紧急联系人电话
     */
    private String contactPhone;
    /**
     * 婚姻状态：0，未婚；1，已婚
     */
    private Short maritalStatus;

    public String getCode() {
        return this.code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        name = StringUtil.handleEmoji(name);
        if (StringUtils.isEmpty(name)) {
            name = "互联网医院患者";
        }
        this.name = name;
    }

    public String getPhoto() {
        return this.photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public Integer getGender() {
        return this.gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Integer getAge() {
        return this.age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getCityId() {
        return this.cityId;
    }

    public void setCityId(Integer city) {
        this.cityId = city;
    }

    public String getPhone() {
        return this.phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getIdCard() {
        return this.idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getBirthday() {
        return this.birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public Short getMaritalStatus() {
        return maritalStatus;
    }

    public void setMaritalStatus(Short maritalStatus) {
        this.maritalStatus = maritalStatus;
    }

    public boolean saveValidate() {
        if (StringUtils.isNotEmpty(this.phone) && (!StringUtils.isNumeric(this.phone) || StringUtils.isEmpty(this.code))) {// 电话号码非空，但不是数字或者没有验证码
            return false;
        }
        return true;
    }
}
